package com.cq.hd.common.enums.biz;

/**
 * 上传图片用途:0-其他，1-用户/商户/商家相关，2-活动，3-商品，4-反馈，5-文章
 */
public enum UploadFileUseEnum {

    OTHER(0, "other"),
    USER(1, "user"),
    ACTIVE(2, "active"),
    PRODUCT(3, "product"),
    FEEDBACK(4, "feedback"),
    CONTENT(5, "content"),
    HF(6, "hf"),
    ;

    private final Integer code;

    private final String name;

    UploadFileUseEnum(final Integer code, final String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String matchNameByCode(Integer code) {
        UploadFileUseEnum[] values = UploadFileUseEnum.values();
        for (UploadFileUseEnum enums : values) {
            if (enums.getCode().equals(code)) {
                return enums.getName();
            }
        }
        return null;
    }


}
